<?php

namespace app\pc\model;
use app\base\model\Base;


class UsersInvest extends Base
{
    //


    public function timu_page($where=[]){
        $files = "*";
        $result = $this->alias("a")
            ->field($files)
            ->where($where)
            ->order("a.created_at")
            //   ->select(false);
            ->paginate(700);


        return     $this->trs_pages_join($result);
    }


    /**
     *  获取用户安全信息
     */
    public function infoAll($where){
        $files = "a.id_number,a.user_name,u.password,m.transact_password,u.mobile,a.user_id";
        $result = $this->alias("a")
            ->field($files)
            ->where($where)
            ->join("users u","u.id=a.user_id","left")
            ->join("users_money m","m.user_id=a.user_id","left")
            ->order("a.created_at")
            ->find();
        if(!empty($result)){
                    $result['pwHas'] = !empty($result['password'])?1:0;
                    $result['tpwHas'] = !empty($result['transact_password'])?1:0;
                    unset($result['password'],$result['transact_password']);
        }
        return $result;

    }

}
